#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django.urls import path, re_path
from rest_framework import routers
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    path("register/", views.UserView.as_view()),  # 注册
    re_path(
        "^usernames/(?P<username>\w{5,20})/count/$", views.UserCountView.as_view()
    ),  # 判断用户名是否已经被注册
    re_path(
        "^mobiles/(?P<mobile>1[3-9]\d{9})/count/$", views.MobileCountView.as_view()
    ),  # 判断手机号是否被注册
    path(r"authorizations/", views.UserAuthorizeView.as_view()),  # 内部认证代码还是Django  登录成功生成token
    path("user_detail/", views.UserDetailView.as_view()),  # 用户详情,
    path("email/", views.EmailView.as_view()),  # 更新邮箱
    path("emails/verification/", views.EmailVerifyView.as_view()),  # 激活邮箱
    path("browse_histories/", views.UserBrowserHistoryView.as_view()),  # 商品浏览记录
]
router = routers.DefaultRouter()
router.register(r"addresses", views.AddressViewSet, base_name="addresses")

urlpatterns += router.urls
